<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title id="TITLE">Corticon Client Demo</title>
		<link type="image/x-icon"
			href="<%=request.getContextPath()%>/favicon.ico" rel="shortcut icon" />
		<meta content="corticon, Inc. http://www.corticon.com"
			name="copyright" />
		<meta
			content=" Corticon® Technologies helps organizations make better, faster decisions by managing the rules that drive their business."
			name="Description" />
		<!-- CSS -->
		<link href="<%=request.getContextPath()%>/style/autumn.css"
			type="text/css" rel="stylesheet" />
		<link href="<%=request.getContextPath()%>/style/jqueryui.all.css"
			type="text/css" rel="stylesheet" />

		<!--[if IE 6]><link href="<%=request.getContextPath()%>/style/autumnie6.css" rel="stylesheet" type="text/css" /><![endif]-->
		<!-- Javascript -->
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/jquery-1.2.6.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/corticon.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/json2.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/jquery-ui-personalized-1.5.3.min.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/Corticon.js"></script>
		<script type="text/javascript">
    $(document).ready(function () {        
        $("#nextpage_bottom").click(function() {
            // If choose a dialog, then begin this dialog directly.           
            var item = $('input[@name=mode][@checked]').val();            
            if (item == undefined){
             		alert("Please choose at least a Mode.");
		            return false;
            }else{        
	            if (item == "explicit"){	            	
	            	Corticon.dialogRequestByExplicit($("#dialogInstanceId").val());
	            }
	            if (item == "implicit"){
		            Corticon.dialogRequestByImplicit();
	            } 
            }           
        });
        
        
	    $("#sessionId").focus(function () {	     	
	    	$("input[@id=mode2]").attr("checked",'implicit');	     	
	    });
        $("#functions").focus(function () {	     	
	    	$("input[@id=mode2]").attr("checked",'implicit');
	    });
        $("#product").focus(function () {
	    	$("input[@id=mode2]").attr("checked",'implicit');
	    });
        $("#region").focus(function () {
	    	$("input[@id=mode2]").attr("checked",'implicit');
	    });
        $("#locale").focus(function () {	     	
	    	$("input[@id=mode2]").attr("checked",'implicit');
	    });
        $("#status").focus(function () {	     	
	    	$("input[@id=mode2]").attr("checked",'implicit');
	    });
	    $("#dialogInstanceId").focus(function () {	    	    	 
	    	$("input[@id=mode1]").attr("checked",'explicit');	     	
	    });
        $("#status").click(function() {
            if ($("#status").val() == "published") {
                $("#effDate").removeAttr("disabled");
            } else {
                $("#effDate").val("");
                $("#effDate").attr("disabled", true);
            }
        });
		
        $("#effDate").datepicker({ dateFormat: 'yy/mm/dd' });
        //Dialogs.clearCookies();
    })
</script>
	</head>
	<body>
		<div id="wrapper">
			<div class="wrapperTop">
				<div class="wrapperTopRt">
					<span></span>
				</div>
			</div>
			<div class="wrapperMid">
				<div class="wrapperMidRt">
					<!--START: Header -->
					<div class="header">
						<h1>
							<a href="http://www.corticon.com">logo</a>
						</h1>
					</div>
					<!--END: Header -->
					<!--START: conent -->
					<div class="content">
						<div class="boxTop">
							<div class="boxTopRt">
								<span></span>
							</div>
						</div>
						<div class="boxMid">
							<div class="boxMidRt">
								<div class="content_top">
									<h2>
										Please specify search criteria for your Dialog!
									</h2>
									<ul class="way">

									</ul>
								</div>
								<div class="incontent">
									<div class="inBoxTop">
										<div class="inBoxTopRt">
											<span></span>
										</div>
									</div>
									<div class="inBoxMid">
										<div class="inBoxMidRt">
											<div class="inBoxMidRt">
												<div class="content_wrap">
													<form name="search_qn" id="search_qn_id"
														action="api/dialogRequest.html" method="post">
														<dl class="specify_criteria">
															<dt>
																<input id="mode1" name="mode" type="radio"
																	value="explicit" />
																explicit
															</dt>
															<dd>
																DialogInstanceId:
																<input type="text" name="dialogInstanceId"
																	id="dialogInstanceId" />
															</dd>
															<dt>
																<input id="mode2" name="mode" type="radio"
																	value="implicit" />
																implicit
															</dt>
															<dd>
																SessionId
															</dd>
															<dd>
																<input type="text" id="sessionId" name="sessionId"
																	value="" />
															</dd>
															<dd>
																Function
															</dd>
															<dd>
																<input type="text" id="functions" name="functions"
																	value="" />
															</dd>
															<dd>
																Product Line
															</dd>
															<dd>
																<input type="text" id="product" name="product"
																	value="" />
															</dd>
															<dd>
																Region
															</dd>
															<dd>
																<input type="text" id="region" name="region" value="" />
															</dd>
															<dd>
																Locale
															</dd>
															<dd>
																<input type="text" id="locale" name="locale" value="" />
															</dd>
															<dd>
																Status
															</dd>
															<dd>																
																<select id="status" name="status">
																	<option value="" selected>
																		---------
																	</option>
																	<option value="inprocess">inprocess</option>
																	<option value="published">published</option>
																	<option value="retired">retired</option>
																</select>
															</dd>
															<dd>
																Date(YYYY/MM/DD)
															</dd>
															<dd>
																<input type="text" id="effDate" name="effDate"
																	disabled="" value="" />
															</dd>
														</dl>
													</form>
												</div>
											</div>
										</div>
									</div>
									<div class="inBoxBtm">
										<div class="inBoxBtmRt">
											<span></span>
										</div>
									</div>
								</div>
								<div class="content_btm">
									<ul>
										<li class="btn_next_page">
											<input type="image"
												src="<%=request.getContextPath()%>/images/btn_search.gif"
												id="nextpage_bottom" />
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="boxBtm">
							<div class="boxBtmRt">
								<span></span>
							</div>
						</div>
					</div>
					<!--END: conent -->
					<!--START: Footer -->
					<div class="footer">
                        Version:${version}
					</div>
					<!--END: Footer -->
				</div>
				<div class="wrapperBtm">
					<div class="wrapperBtmRt">
						<span></span>
					</div>
				</div>
			</div>
		</div>
		</div>

	</body>
</html>